package org.wltea.analyzer.lucene;

import java.util.Map;

import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.util.TokenizerFactory;
import org.apache.lucene.util.AttributeFactory;

/**
 * 用于远程调用更新词库
 * 
 * @author Tony
 *
 */
public class IKTokenizerFactoryRemote extends TokenizerFactory {

	private boolean useSmart = false;

	public IKTokenizerFactoryRemote(Map<String, String> args) {
		super(args);
		this.useSmart = getBoolean(args, "useSmart", false);
	}

	@Override
	public Tokenizer create(AttributeFactory attributeFactory) {
		return new IKTokenizer(attributeFactory, useSmart());
	}

	private boolean useSmart() {
		return this.useSmart;
	}

}
